package com.doudou.activity.controller;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.doudou.activity.model.SubjectType;
import com.doudou.activity.service.SubjectTypeService;
import com.doudou.platform.utils.TableNameUtils;

/**
 *  线下活动发布 controller 
 * @author jinliang
 *
 */

@Controller
@RequestMapping("/offlineactivity")
@SuppressWarnings("restriction")
public class OffLineActivityController {
	//时间
	private List<SubjectType> dataList = new ArrayList<SubjectType>();
	//模块
	private List<SubjectType> modelList = new ArrayList<SubjectType>();
	//地点
	private List<SubjectType> cityList = new ArrayList<SubjectType>();
	@Resource(name="subjectTypeService")
	private SubjectTypeService subjectTypeService;
	@RequestMapping("/get")
	public String getActivity(ModelMap modelMap) {
		System.out.println("------zhaopin -----");
		// 获取时间段
		dataList.clear();
		dataList = subjectTypeService.getSubjectTypeByCatetype(TableNameUtils.data_Type);
		
		modelList.clear();
		modelList = subjectTypeService.getSubjectTypeByCatetype(TableNameUtils.model_type);
		
		cityList.clear();
		cityList = subjectTypeService.getSubjectTypeByCatetype(TableNameUtils.city_type);
		
		// 获取兴趣点；
		// 获取排序状态；
		
		modelMap.put("dataList", dataList);
		modelMap.put("modelList", modelList);
		modelMap.put("cityList", cityList);
		return "/index/login.jsp";
	}
	

}
